imagesid=`docker images|grep -i lover|awk '{print $3}'`
project=/root/code/orange-sharp
name=orange-app-api
if ! -n "$imagesid";then
   echo $imagesid "is null"
	docker stop $name 
	docker rmi $imagesid -f 
	echo $imagesid "has del"
else
    docker rmi $imagesid -f
fi
cd $project
git pull
echo "git pull success"
#docker build -t orange-app-api .
mvn package docker:build
if docker ps -a|grep -i $name;then
   docker rm -f $name
echo "success rm lover"
fi

echo "begin run"
docker run -it -d -p 8008:8008 -e "SPRING_PROFILES_ACTIVE=dev" --name lover find-lover/lover
